#
# lombo memctrl specific Makefile
#

obj-y += memctrl.o memctrl_conf.o memctrl_dev.o monitor.o

ifeq ($(CONFIG_ARCH_LOMBO_N7V1), y)
MEMCTRL_CSP_PLATFORM := n7v1
endif

ifeq ($(CONFIG_ARCH_LOMBO_N7V3), y)
MEMCTRL_CSP_PLATFORM := n7v3
endif

ifeq ($(CONFIG_ARCH_LOMBO_N7V5), y)
MEMCTRL_CSP_PLATFORM := n7v5
endif

ifeq ($(CONFIG_ARCH_LOMBO_N7V7), y)
MEMCTRL_CSP_PLATFORM := n7v7
endif

ifeq ($(CONFIG_ARCH_LOMBO_N5V1), y)
MEMCTRL_CSP_PLATFORM := n5v1
endif

ifeq ($(CONFIG_ARCH_LOMBO_N9V1), y)
MEMCTRL_CSP_PLATFORM := n9v1
endif

SOURCE := $(srctree)/$(src)/csp/$(MEMCTRL_CSP_PLATFORM)/csp_memctrl.c

ifneq ($(wildcard $(SOURCE)), )
obj-y += csp/$(MEMCTRL_CSP_PLATFORM)/
else
ifneq ($(TARGET_TOOLS_PREFIX), arm-ez-linux-uclibcgnueabihf-)
uclibc_prefix:=
else
uclibc_prefix:=uclibc/
endif
obj-y += liblombo_memctrl.o
$(obj)/liblombo_memctrl.o: $(src)/csp/$(MEMCTRL_CSP_PLATFORM)/$(uclibc_prefix)liblombo_memctrl
	cp $< $@
endif
